logo

Text goes here

Create a visKey. Could also do it external to R and import.

visKey <-
  tribble(~layer, ~min, ~max, ~addR, ~r,
        1,250,290,0,1,
        2,250,290,0,2,
        3,260,280,0,3,
        4,260,280,0,4,
        5,250,290,0,5)

visKey
## # A tibble: 5 x 5
##   layer   min   max  addR     r
##   <dbl> <dbl> <dbl> <dbl> <dbl>
## 1     1   250   290     0     1
## 2     2   250   290     0     2
## 3     3   260   280     0     3
## 4     4   260   280     0     4
## 5     5   250   290     0     5

Explain what arguments vis_layout has.

There are some errors manifesting in the node positions that needs to be checked

plot_layout <- vis_layout(edgelist = de, 
                          vInfo = dv, 
                          minSpacing = 0, maxSpacing = 1000, 
                          key = visKey)
plot_layout
## $edges
## # A tibble: 20 x 9
##    from.level to.level layer  from      to               x     y      xend  yend
##         <dbl>    <dbl> <chr>  <chr>     <chr>        <dbl> <dbl>     <dbl> <dbl>
##  1          1        2 l1FP_~ Provide ~ Increas~ -1.84e-16 -1    -6.84e- 1 -1.88
##  2          1        2 l1FP_~ Provide ~ Road us~ -1.84e-16 -1    -3.67e-16 -2   
##  3          2        2 l2VPM~ Increase~ Complia~ -6.84e- 1 -1.88  6.84e- 1 -1.88
##  4          2        3 l2VPM~ Increase~ Effecti~ -6.84e- 1 -1.88 -1.03e+ 0 -2.82
##  5          2        3 l2VPM~ Increase~ Safe ef~ -6.84e- 1 -1.88 -3.22e-15 -3   
##  6          2        2 l2VPM~ Road use~ Complia~ -3.67e-16 -2     6.84e- 1 -1.88
##  7          2        3 l2VPM~ Road use~ Effecti~ -3.67e-16 -2    -1.03e+ 0 -2.82
##  8          2        3 l2VPM~ Road use~ Safe ef~ -3.67e-16 -2    -3.22e-15 -3   
##  9          2        3 l3GF_~ Complian~ Driver ~  6.84e- 1 -1.88  1.03e+ 0 -2.82
## 10          2        4 l3GF_~ Complian~ Road Tr~  6.84e- 1 -1.88 -1.04e+ 0 -3.86
## 11          2        4 l3GF_~ Complian~ Vehicle~  6.84e- 1 -1.88  1.37e+ 0 -3.76
## 12          3        3 l3GF_~ Effectiv~ Driver ~ -1.03e+ 0 -2.82  1.03e+ 0 -2.82
## 13          3        4 l3GF_~ Effectiv~ Road Tr~ -1.03e+ 0 -2.82 -1.04e+ 0 -3.86
## 14          3        4 l3GF_~ Effectiv~ Vehicle~ -1.03e+ 0 -2.82  1.37e+ 0 -3.76
## 15          3        3 l3GF_~ Safe eff~ Driver ~ -3.22e-15 -3     1.03e+ 0 -2.82
## 16          3        4 l3GF_~ Safe eff~ Road Tr~ -3.22e-15 -3    -1.04e+ 0 -3.86
## 17          3        4 l3GF_~ Safe eff~ Vehicle~ -3.22e-15 -3     1.37e+ 0 -3.76
## 18          3        5 l4ORP~ Driver c~ Vehicle~  1.03e+ 0 -2.82 -9.18e-16 -5   
## 19          4        5 l4ORP~ Road Tra~ Vehicle~ -1.04e+ 0 -3.86 -9.18e-16 -5   
## 20          4        5 l4ORP~ Vehicle ~ Vehicle~  1.37e+ 0 -3.76 -9.18e-16 -5   
## 
## $vertices
## # A tibble: 10 x 6
##    level vName                                               x     y   pos theta
##    <dbl> <chr>                                           <dbl> <dbl> <int> <dbl>
##  1     1 Provide efficient and accessible mobility   -1.84e-16 -1        1  4.71
##  2     2 Increased road user safety                  -6.84e- 1 -1.88     1  4.36
##  3     2 Road user satisfaction                      -3.67e-16 -2        2  4.71
##  4     2 Compliant user behaviour                     6.84e- 1 -1.88     3  5.06
##  5     3 Effective occupant protection               -1.03e+ 0 -2.82     1  4.36
##  6     3 Safe efficient traffic flow                 -3.22e-15 -3        2  4.71
##  7     3 Driver capabilities and limitations          1.03e+ 0 -2.82     3  5.06
##  8     4 Road Transportation System capabilities an~ -1.04e+ 0 -3.86     1  4.45
##  9     4 Vehicle capacity                             1.37e+ 0 -3.76     2  5.06
## 10     5 Vehicle components                          -9.18e-16 -5        1  4.71

Function to quickly plot a ggplot. Can still edit this in situ. Or start from scratch. If key is specified, the circles are drawn??

plot_ggplot <- vis_ggplot(plot_layout, key = visKey)
plot_ggplot

Lastly is plotly.

plot_plotly <- vis_plotly(plot_ggplot, circles = TRUE)
plot_plotly